package com.gxa.web_admin.controller;

import com.gxa.common.vo.JsonResult;
import com.gxa.common.vo.R;
import com.gxa.modules.service.CysService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;

@RestController
@RequestMapping("/cys")
public class CysDriverController {
    @Autowired
    private CysService cysService;

    /**
     * 查询车辆列表和条件查询
     * @param map
     * @return
     */
    @PostMapping("/findCysDriver")
    public JsonResult findCysDriver(@RequestBody HashMap map){
        return cysService.findCysDriver(map);
    }

    /**
     * 添加车辆
     * @param map
     * @return
     */
    @PostMapping("/addCysDriver")
    public R addCysDriver(@RequestBody HashMap map){
        return cysService.addCysDriver(map);
    }

    @GetMapping("/findCysDriverById")
    public R findCysDriverById(Integer driver_id){
        return cysService.findCysDriverById(driver_id);
    }

    /**
     * 编辑
     * @param map
     * @return
     */
    @PostMapping("/updateCysDriver")
    public R updateCysDriver(@RequestBody HashMap map){
        return cysService.updateCysDriver(map);
    }

    /**
     * 删除
     * @param driver_id
     * @return
     */
    @GetMapping("/delCysDriver")
    public R delCysDriver(Integer driver_id){
        return cysService.delCysDriver(driver_id);
    }

    @GetMapping("/findAgentName")
    public R findAgentName(){
        return cysService.findAgentName();
    }
}
